package cz.uhk.gui.tableModel;

import javax.swing.table.AbstractTableModel;

public class TableModelIncidence extends AbstractTableModel{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 7725473810222607691L;
	int[] mistnosti ;
	float[][] incidence;
	
	public TableModelIncidence(float[][] incidence){
		this.incidence = incidence;
		mistnosti = new int[incidence.length];
		for(byte i = 0; i < incidence.length; i++){
			mistnosti[i] = i+1;
		}
	}

	public int getColumnCount() {
		
		return incidence.length+1;
	}

	public int getRowCount() {
		return incidence[0].length+1;
	}

	public Object getValueAt(int r, int c) {
		if(r==0 && c==0) return "";
		if(r==0) return mistnosti[c-1];
		if(c==0) return mistnosti[r-1];
		return incidence[r-1][c-1];
	}

}
